PORTNAME=	mutter
PORTVERSION=	43.8
CATEGORIES=	x11-wm
#MASTER_SITES=	GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+)\..*/\1/}
DIST_SUBDIR=	gnome

MAINTAINER=	gnome@FreeBSD.org
COMMENT=	Window and compositing manager based on Clutter
WWW=		https://gitlab.gnome.org/GNOME/mutter

LICENSE=	GPLv2+
LICENSE_FILE=	${WRKSRC}/COPYING

BUILD_DEPENDS=	evdev-proto>0:devel/evdev-proto \
		gnome-settings-daemon>0:sysutils/gnome-settings-daemon \
		gsettings-desktop-schemas>=3.4.0:devel/gsettings-desktop-schemas \
		xkeyboard-config>=0:x11/xkeyboard-config \
		zenity>=3.0.0:x11/zenity \
		xwayland>0:x11-servers/xwayland
LIB_DEPENDS=	libcanberra-gtk3.so:audio/libcanberra-gtk3 \
		libcanberra.so:audio/libcanberra \
		libgudev-1.0.so:devel/libgudev \
		libdrm.so:graphics/libdrm \
		libinput.so:x11/libinput \
		libgbm.so:graphics/mesa-libs \
		libfontconfig.so:x11-fonts/fontconfig \
		libfreetype.so:print/freetype2 \
		libfribidi.so:converters/fribidi \
		libgraphene-1.0.so:graphics/graphene \
		libjson-glib-1.0.so:devel/json-glib \
		libstartup-notification-1.so:x11/startup-notification \
		libupower-glib.so:sysutils/upower \
		libxkbcommon.so:x11/libxkbcommon \
		libxkbfile.so:x11/libxkbfile \
		liblcms2.so:graphics/lcms2 \
		libcolord.so:graphics/colord
RUN_DEPENDS=	gnome-settings-daemon>0:sysutils/gnome-settings-daemon \
		gsettings-desktop-schemas>=3.4.0:devel/gsettings-desktop-schemas \
		xkeyboard-config>=0:x11/xkeyboard-config \
		zenity>=3.0.0:x11/zenity

USES=		compiler:c++0x gettext gl gnome localbase meson pkgconfig \
		xorg
USE_GL=		egl gbm
USE_GNOME=	cairo gdkpixbuf2 gnomedesktop3 introspection:build
USE_XORG=	ice sm x11 xcb xcomposite xcursor xdamage xext xfixes xi \
		xinerama xrandr xrender xtst
USE_LDCONFIG=	yes
CFLAGS+=	-Wno-unknown-warning-option -Wno-format-nonliteral
CPPFLAGS+=	-fno-omit-frame-pointer

USE_GITLAB=	yes
GL_SITE=	https://gitlab.gnome.org
GL_ACCOUNT=	GNOME
GL_TAGNAME=	e943bc6d75e0777d4f07e66ed7e2a87245c75e61

MESON_ARGS=	-Dlibwacom=false \
		-Dnative_backend=false \
		-Dprofiler=false \
		-Dsystemd=false \
		-Dtests=false \
		-Dinstalled_tests=false \
		-Dwayland=false

# Required by embedded cogl/clutter forks.
MESON_ARGS+=	-Dgles2_libname=libGLESv2 \
		-Dopengl_libname=libGL.so

# Disable remote_desktop for now because it requires memfd which only appears current
MESON_ARGS+=	-Dremote_desktop=false

GLIB_SCHEMAS=	org.gnome.mutter.gschema.xml \
		org.gnome.mutter.wayland.gschema.xml

.include <bsd.port.mk>
